const dns = require("dns");
// console.log(dns.lookupService)
// dns.lookupService('192.168.100.101',53, (a,b,c) => {
//     console.log( a,b,c);
//     // if (address){
//     //     reverse(address);
//     // }
// });
dns.setServers(['127.0.0.1:53536']);
lookup('qqylll.com');
// reverse('103.97.129.254');
console.log(dns.getServers())
function lookup(domain){
    dns.lookup(domain, (err, address, family) => {
        console.log('ip 地址:', err, address);
        if (address){
            // reverse(address);
        }
    });
}
// reverse('127.0.0.1');
function reverse(ip){
    dns.reverse(ip, (err, hostnames) => {
        if (err) {
            console.log(err.stack);
        }

        console.log(`反向解析:${ip}， ${JSON.stringify(hostnames)}`);
    });

}
